//
//  GFLxdDetailTableViewCell.m
//  Qyer
//
//  Created by dlios on 15/10/24.
//  Copyright (c) 2015年 GF. All rights reserved.
//

#import "GFLxdDetailTableViewCell.h"

@implementation GFLxdDetailTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _desLable = [[UILabel alloc] initWithFrame:CGRectZero];
        [_desLable setTextColor:[NightMode shareNightModeHandle].wordColor];
        [_desLable setNumberOfLines:0];
        [_desLable setFont:[UIFont systemFontOfSize:WIDTH * 14.]];
        [self.contentView addSubview:_desLable];
        
        _scView = [[UIScrollView alloc] initWithFrame:CGRectZero];
        [_scView setBounces:NO];
        [_scView setPagingEnabled:NO];
        [_scView setShowsHorizontalScrollIndicator:NO];
        [_scView setDelegate:self];
        [_scView setContentOffset:CGPointMake(0, 0) animated:YES];
        [self.contentView addSubview:_scView];
        
        
    }
    return self;
}

- (void)getJnModel:(GFJnModel *)model{
    [_desLable setFrame:CGRectMake(5 * WIDTH, 5 * HEIGHT, SCREEN_WIDTH - 10 * WIDTH, model.height)];
    [_desLable setText:model.des];
    [_scView setFrame:CGRectMake(5 * WIDTH, 10 * HEIGHT + model.height, SCREEN_WIDTH - 10 * WIDTH, 120 * HEIGHT)];
    [_scView setContentSize:CGSizeMake(170 * WIDTH * model.notes.count, 0)];
    for (NSDictionary *dic in model.notes) {
        [_image sd_setImageWithURL:[NSURL URLWithString:[dic objectForKey:@"photo_url"]] placeholderImage:[UIImage imageNamed:@"zw.png"]];
        for (int i = 0; i < model.notes.count; i++) {
//            NSLog(@"gggggggggggggggggg%ld", model.notes.count);
            _image = [[UIImageView alloc] initWithFrame:CGRectMake(5 * WIDTH + 170 * WIDTH * i, 0, 165 * WIDTH, 120 * HEIGHT)];
        }
        [_scView addSubview:_image];
    }
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
